using System;

namespace ASPNETVN.PORTAL.Components.Configuration.Items
{
    public class Module : IComparable
    {
        private string _AuthorizedViewRoles = "-1";
        private string _AuthorizedAddRoles = "1";
        private string _AuthorizedEditRoles = "1";        
        private string _AuthorizedDeleteRoles = "1";
        private string _AuthorizedSettingRoles = "1";
        private string _AuthorizedManagerRoles = "1";
        private string _AuthorizedSecurityRoles = "1";

        private int _CacheTimeOut;
        private int _ID;
        private int _ModuleDefinitionID;
        private Guid _GeneralDefinitionID;
        private int _Order;
        private string _PaneName;
        private bool _ShowEveryWhere;
        private string _SourceFile;
        private int _TabID;
        private string _Title;

        public int Order
        {
            get { return this._Order; }
            set { this._Order = value; }
        }

        public bool ShowEveryWhere
        {
            get { return this._ShowEveryWhere; }
            set { this._ShowEveryWhere = value; }
        }

        public string Title
        {
            get { return this._Title; }
            set { this._Title = value; }
        }

        public string PaneName
        {
            get { return this._PaneName; }
            set { this._PaneName = value; }
        }

        public int ID
        {
            get { return this._ID; }
            set { this._ID = value; }
        }

        public int ModuleDefinitionID
        {
            get { return this._ModuleDefinitionID; }
            set { this._ModuleDefinitionID = value; }
        }

        public int CacheTimeOut
        {
            get { return this._CacheTimeOut; }
            set { this._CacheTimeOut = value; }
        }

        public string AuthorizedAddRoles
        {
            get { return this._AuthorizedAddRoles; }
            set { this._AuthorizedAddRoles = value; }
        }

        public string AuthorizedEditRoles
        {
            get { return this._AuthorizedEditRoles; }
            set { this._AuthorizedEditRoles = value; }
        }

        public string AuthorizedViewRoles
        {
            get { return this._AuthorizedViewRoles; }
            set { this._AuthorizedViewRoles = value; }
        }

        public int TabID
        {
            get { return this._TabID; }
            set { this._TabID = value; }
        }

        public string SourceFile
        {
            get { return this._SourceFile; }
            set { this._SourceFile = value; }
        }

        public string AuthorizedDeleteRoles
        {
            get { return this._AuthorizedDeleteRoles; }
            set { this._AuthorizedDeleteRoles = value; }
        }

        public string AuthorizedSettingRoles
        {
            get { return _AuthorizedSettingRoles; }
            set { _AuthorizedSettingRoles = value; }
        }

        public string AuthorizedManagerRoles
        {
            get { return _AuthorizedManagerRoles; }
            set { _AuthorizedManagerRoles = value; }
        }

        public string AuthorizedSecurityRoles
        {
            get { return _AuthorizedSecurityRoles; }
            set { _AuthorizedSecurityRoles = value; }
        }

        public Guid GeneralDefinitionID
        {
            get { return this._GeneralDefinitionID; }
            set { this._GeneralDefinitionID = value; }
        }

        #region IComparable Members

        public int CompareTo(object value)
        {
            if (value == null) return 1;

            int compareOrder = ((Module)value).Order;

            if (this.Order == compareOrder) return 0;
            if (this.Order < compareOrder) return -1;
            if (this.Order > compareOrder) return 1;
            return 0;
        }

        #endregion
    }
}